<?
    require_once("om/CmsImagePeer.php");
    require_once("om/BinaryFilePeer.php");

    $sql = "SELECT image.binary_file_id, binary_file.file_name FROM image ".
           "LEFT JOIN binary_file ON image.binary_file_id=binary_file.binary_file_id ".
           "WHERE image.is_content = 1 ".
           "ORDER BY image.modified_date DESC";

    $con = Propel::getConnection(CmsImagePeer::DATABASE_NAME);
    $stmt = $con->prepareStatement($sql);
    $rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
    $counter = 0;
?>
var tinyMCEImageList = new Array(<? while($rs->next()) { ?>["<?=$rs->get(2)?>", "image?id=<?=$rs->get(1)?>"]<?=++$counter < $rs->getRecordCount() ? "," : ""?><? } ?>);